[AIE] Fix sub-register index composition in split instruction rewriter#968
Merged
Merged
Conversation
Add a test case for when a tuple operand already has a sub-register index (e.g., %R.sub_hi_dim). The aie-split-instrs-create pass should compose the indices correctly (e.g., sub_hi_dim_then_sub_mod instead of sub_mod). The current CHECK lines reflect the buggy behavior where the existing sub-register index is overwritten instead of composed.
When splitting a tuple instruction operand that already has a sub-register index (e.g., %R.sub_hi_dim), the aie-split-instrs-create pass was overwriting the existing index with the new split sub-register (e.g., sub_mod) instead of composing them (sub_hi_dim_then_sub_mod). This caused downstream passes to reference wrong sub-register lanes. For example, a PADD_2D_pseudo using the high dimension of an eds register would have its split operands reference the low dimension sub-registers, leading to undefined uses that later crashed in the AIESuperRegRewriter pass with 'Virtual register defs don't dominate all uses'. Fix by using TRI.composeSubRegIndices() to properly compose the existing sub-register index with the new split sub-register index.
SagarMaheshwari99
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When splitting a tuple instruction operand that already has a
sub-register index (e.g., %R.sub_hi_dim), the aie-split-instrs-create
pass was overwriting the existing index with the new split sub-register
(e.g., sub_mod) instead of composing them (sub_hi_dim_then_sub_mod).
This caused downstream passes to reference wrong sub-register lanes.
For example, a PADD_2D_pseudo using the high dimension of an eds
register would have its split operands reference the low dimension
sub-registers, leading to undefined uses that later crashed in
the AIESuperRegRewriter pass with 'Virtual register defs don't
dominate all uses'.
Fix by using TRI.composeSubRegIndices() to properly compose the
existing sub-register index with the new split sub-register index.